package com.lnsf.bookstore.system.topic.service.impl;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.topic.dao.TopicMapper;
import com.lnsf.bookstore.system.topic.vo.Topic;
import com.lnsf.bookstore.system.topic.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class TopicServiceImpl implements TopicService {

    @Autowired
    private TopicMapper topicMapper;


    @Override
    public int save(Topic topic) {
        return topicMapper.insertSelective(topic);
    }

    @Override
    public Topic queryObject(Integer id) {
        return topicMapper.queryObject(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return topicMapper.deleteBatch(ids);
    }

    @Override
    public int update(Topic topic) {
        return topicMapper.updateByPrimaryKeySelective(topic);
    }

    @Override
    public PageInfo<Topic> queryList(Map<String, Object> params) {
        return new PageInfo<Topic>(topicMapper.queryList(params));
    }
}
